import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '@/views/index.vue'
import Home from '@/views/tabbar/home.vue'
import Cates from '@/views/tabbar/cates.vue'
import Search from '@/views/tabbar/search.vue'
import Cart from '@/views/tabbar/cart.vue'
import My from '@/views/tabbar/my.vue'

Vue.use(VueRouter)

const routes = [
  { path: '/', redirect: '/home' },
  {
    path: '/index', component: Index,
    children: [
      { path: '/home', component: Home },
      { path: '/cates', component: Cates },
      { path: '/search', component: Search },
      { path: '/cart', component: Cart },
      { path: '/my', component: My }
    ]
  },
]

const router = new VueRouter({
  routes
})

export default router
